package com.example.controll.dingdan;

import com.example.config.R;
import com.example.domain.dingdan;
import com.example.service.dingdan.dingdanService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/dingdan")
public class dingdanControll {
    @Resource
    private dingdanService dingdanService;

    @RequestMapping("/openid")
    private R findDingDan(dingdan dingdan){
        System.out.println("aaaa");
        System.out.println(dingdan.getUser_openid());
        String openid ="'"+dingdan.getUser_openid()+"'";
        return new R(true,dingdanService.findDingdan(openid));
    }

    @RequestMapping("/lease")
    private R findLease(dingdan dingdan){
        System.out.println("aaaa");
        System.out.println(dingdan.getUser_openid());
        String openid ="'"+dingdan.getUser_openid()+"'";
        return new R(true,dingdanService.findLease(openid));
    }

}
